/**  

* @Title: AdminManagerImpl.java 

* @Package com.gxbadge.service.impl 

* @Description: TODO(用一句话描述该文件做什么) 

* @author CST

* @version V1.0  

*/ 

package com.gxbadge.service.impl;

import java.util.List;

import com.gxbadge.dao.AdministratorDao;
import com.gxbadge.dao.ArticleDao;
import com.gxbadge.dao.CategoryDao;
import com.gxbadge.dao.ContactDao;
import com.gxbadge.dao.ImageDao;
import com.gxbadge.dao.ImageInfoDao;
import com.gxbadge.dao.LanguageDao;
import com.gxbadge.dao.NavigationDao;
import com.gxbadge.dao.OperatorDao;
import com.gxbadge.model.Administrator;
import com.gxbadge.model.Article;
import com.gxbadge.model.Category;
import com.gxbadge.model.Image;
import com.gxbadge.model.ImageInfo;
import com.gxbadge.model.Language;
import com.gxbadge.model.Navigation;
import com.gxbadge.model.Operator;

import com.gxbadge.service.AdminManager;

public class AdminManagerImpl implements AdminManager {

	private AdministratorDao administratorDao;
	private ArticleDao articleDao;
	private CategoryDao categoryDao;
	private ContactDao contactDao;
	private ImageDao imageDao;
	private ImageInfoDao imageInfoDao;
	private LanguageDao languageDao;
	private NavigationDao navigationDao;
	private OperatorDao operatorDao;
	public AdministratorDao getAdministratorDao() {
		return administratorDao;
	}
	public void setAdministratorDao(AdministratorDao administratorDao) {
		this.administratorDao = administratorDao;
	}
	public ArticleDao getArticleDao() {
		return articleDao;
	}
	public void setArticleDao(ArticleDao articleDao) {
		this.articleDao = articleDao;
	}
	public CategoryDao getCategoryDao() {
		return categoryDao;
	}
	public void setCategoryDao(CategoryDao categoryDao) {
		this.categoryDao = categoryDao;
	}
	public ContactDao getContactDao() {
		return contactDao;
	}
	public void setContactDao(ContactDao contactDao) {
		this.contactDao = contactDao;
	}
	public ImageDao getImageDao() {
		return imageDao;
	}
	public void setImageDao(ImageDao imageDao) {
		this.imageDao = imageDao;
	}
	public ImageInfoDao getImageInfoDao() {
		return imageInfoDao;
	}
	public void setImageInfoDao(ImageInfoDao imageInfoDao) {
		this.imageInfoDao = imageInfoDao;
	}
	public LanguageDao getLanguageDao() {
		return languageDao;
	}
	public void setLanguageDao(LanguageDao languageDao) {
		this.languageDao = languageDao;
	}
	public NavigationDao getNavigationDao() {
		return navigationDao;
	}
	public void setNavigationDao(NavigationDao navigationDao) {
		this.navigationDao = navigationDao;
	}
	public OperatorDao getOperatorDao() {
		return operatorDao;
	}
	public void setOperatorDao(OperatorDao operatorDao) {
		this.operatorDao = operatorDao;
	}
	
	/* --------------------------------登录验证--------------------------------------------------- */
	/**
	 * @note (登录验证)
	 * @param (Administrator admin)
	 * @return (boolean类型)
	 */
	public boolean validLogin(Administrator admin) {
		return false;
	}
	
	/**
	 * @note (退出处理)
	 * @param (Administrator admin)
	 * @return ()
	 */
	public void logout(Administrator admin) {
	}
	
	
	/* --------------------------------管理员信息--------------------------------------------------- */
	
	//管理员信息管理	
	/**
	 * @note (添加管理员)
	 * @param (Administrator admin)
	 * @return ()
	 */
	public void add_admin(Administrator admin) {
		
		administratorDao.save(admin);
	}
	
	/**
	 * @note (根据adminId删除管理员)
	 * @param (Integer adminId)
	 * @return ()
	 */
	public void del_admin(Administrator admin) {
		
		administratorDao.delete(admin);
	}
	
	/**
	 * @note (根据更新管理员信息)
	 * @param (Integer adminId)
	 * @return ()
	 */
	public void modify_adminByAdmin(Administrator admin) {
		
		administratorDao.update(admin);
	}
	
	/**
	 * @note (通过用户名查找管理员信息)
	 * @param (Administrator admin)
	 * @return ()
	 */
	public Administrator findAdminByName(String name) {
		return null;
	}
	
	/**
	 * @note (通过用户名密码查找管理员)
	 * @param (Administrator admin)
	 * @return ()
	 */
	public Administrator findAdminByNameAndPass(String name, String password) {
		
		return administratorDao.findAdminByNameAndPassword(name, password);
	}
	
	/**
	 * @note (查找所有管理员)
	 * @param (Administrator admin)
	 * @return ()
	 */
	public List<Administrator> findAdminListAll() {
		return administratorDao.findAdminAll();
	}
	
	/**
	 * @note (根据adminId查找管理员)
	 * @param (Integer adminId)
	 * @return (Administrator admin)
	 */
	public Administrator findAdminByAdminId(Integer adminId) {
		return administratorDao.findAdminByAdminId(adminId);
	}
	
	
	/*
	 *  -------------------系统模块处理------------------                        
	 *  -------------------包括用户中心、系统管理、网站管理、留言信箱4部分
	 */
	
	public void add_cate(Category cate) {
		categoryDao.save(cate);
	}	
	public void del_cate(Category cate) {
		categoryDao.delete(cate);
	}
	public void modify_cate(Category cate) {
		
		categoryDao.update(cate);
		
	}
	public Category findCateByCateId(Integer cateId) {
		return categoryDao.findCategoryByCateId(cateId);
	}
	public List<Category> findCateListByCatePid(Integer catePid) {
		return categoryDao.findCategoryByCatePid(catePid);
	}
	public List<Category> findCateAll() {
		return null;
	}
	public Category findCateByNote(String note) {
		
		return categoryDao.findCateByNote(note);
		
	}
	
	/* --------------------------------语言模块--------------------------------------------------- */
	
	public void add_lang(Language lang){
		
		languageDao.save(lang);
		
	}
	public void del_lang(Language lang){
		
		languageDao.delete(lang);
		
	}
	public void modify_lang(Language lang){
		
		languageDao.update(lang);
		
	}
	public List<Language> findLangAll(){
		
		return languageDao.findLangAll();
		
	}
	public Language findLangByLangId(Integer langId){
		
		return languageDao.findLangByLangId(langId);
		
	}
	

	/*
	 *  -------------------网站导航处理------------------                        
	 *  -------------------包括用户中心、系统管理、网站管理、留言信箱4部分
	 */
	public List<Navigation> findNavListByNavPid(int navPid){
		
		
		return navigationDao.findNavListByNavPid(navPid);
	}
	
	public Navigation findNavByNavId(int navId){
		
		return navigationDao.findNavByNavId(navId);
	}
	public void add_nav(Navigation nav){
		
		navigationDao.save(nav);
		
	}
	public void del_nav(Navigation nav){
		
		navigationDao.delete(nav);
		
	}
	public void modify_nav(Navigation nav){
		
		navigationDao.update(nav);
		
	}
	/*---------------前台--------------------- */
	public Navigation findNavByNote(String note){
		
		return navigationDao.findNavByNote(note);
		
	}
	
	/*
	 *  ------------------操作模块处理------------------                        
	 *  -------------------
	 */
	public List<Operator> findOperListByNav(Navigation nav){
		
		return operatorDao.findOperListByNav(nav);
	}
	public void add_oper(Operator oper){
		
		operatorDao.save(oper);
		
	}
	public void del_oper(Operator oper){
		
		operatorDao.delete(oper);
		
	}
	public void modify_oper(Operator oper){
		
		operatorDao.update(oper);
		
	}
	public Operator findOperByOperId(int operId){
		
		return operatorDao.findOperByOperId(operId);
		
	}
	
	
	
	
	
	
	
	
	/* --------------------------------图片处理--------------------------------------------------- */
	
	public void add_image(Image image){
		
		imageDao.save(image);

	}
	public void del_image(Image image){
		
		image.setDeleteFlag(true);
		imageDao.update(image);
		
	}
	public void modify_image(Image image){
		
		imageDao.update(image);
		
	}
	public List<Image> findImageAll(){
		
		return imageDao.findImageAll();
	}
	
	public List<Image> findImageByArti(Article arti){
		
		return imageDao.findImageByArti(arti);
	}
	
	public List<Image> findImageAllByPage(int offset, int pageSize){
		
		return imageDao.findImageAllByPage(offset, pageSize);
	}
	
	public List<Image> findImageListByNavListAndPage(List<Navigation> navList, int offset, int pageSize){
		
		return imageDao.findImageByNavListAndPage(navList, offset, pageSize);
		
	}
	
	public List<Image> findImageByNav(Navigation nav){
		
		
		return null;
	}
	
	public List<Image> findImageByNavAndPage(int offset, int pageSize, Navigation nav){
		
		return imageDao.findImageByNavAndPage(offset, pageSize, nav);
	}
	
	public Image findImageByImageId(int imageId){
		
		return imageDao.findImageByImageId(imageId);
	}
	
	public long find_imageAllCount(){
		
		return imageDao.find_imageAllCount();
	}
	public long find_imageCountByNav(Navigation nav){
		
		return imageDao.find_imageCountByNav(nav);
		
	}
	
	public long find_imageListCountByNavList(List<Navigation> navList){
		
		return imageDao.find_imageListCountByNavList(navList);
	}
	
	
	/* --------------------------------图片处理----------前台----------------------------------------- */
	
	public List<Image> findImageByNavListAndPage(List<Navigation> navList, int offset, int pageSize){
		
		return imageDao.findImageByNavListAndPage(navList, offset, pageSize);
	}
	
	public List<Image> f_findImageByNavAndPage(Navigation nav, int offset, int pageSize){
		
		return imageDao.findImageByNavAndPage(nav, offset, pageSize);
	}
	public long f_find_imageCountByNav(Navigation nav){
		
		return imageDao.f_find_imageCountByNav(nav);
	}
	
	/* --------------------------------图片信息处理--------------------------------------------------- */
	
	public void add_imageInfo(ImageInfo imageInfo){
		
		imageInfoDao.save(imageInfo);
		
	}
	public void del_imageInfo(ImageInfo imageInfo){
		
		imageInfoDao.delete(imageInfo);
		
	}
	public void modify_imageInfo(ImageInfo imageInfo){
		
		imageInfoDao.update(imageInfo);
		
	}
	
	public ImageInfo findImageInfoByImage(Image image){
		
		return imageInfoDao.findImageInfoByImage(image);
		
	}
	public ImageInfo findImageInfoByImageInfoId(int imageInfoId){
		
		return imageInfoDao.findImageInfoByImageInfoId(imageInfoId);
		
	}
	
	/*
	 *  ------------------文章模块处理------------------                        
	 *  -------------------
	 */
	public List<Article> findArtiListByNav(Navigation nav){
		
		return articleDao.findArtiListByNav(nav);
	}
	public void add_arti(Article arti){
		
		articleDao.save(arti);
	}
	public void del_arti(Article arti){
		
		articleDao.delete(arti);
	}
	public void modify_arti(Article arti){
		articleDao.update(arti);
	}
	public Article findArtiByArtiId(int artiId){
		
		return articleDao.findArticleByArtiId(artiId);
		
	}
	public List<Article> findArtiListByNavList(List<Navigation> navList, int offset, int pageSize){
		
		return articleDao.findArtiListByNavList(navList, offset, pageSize);
		
	}
	
	public long find_artiTotalCount(List<Navigation> navList){
		
		return articleDao.find_artiTotalCount(navList);
	}
	
	/* ------------------文章模块处理-------前台-----------    */                    
	public List<Article> findFrontArtiListByNavList(List<Navigation> navList, int offset, int pageSize){
		
		return articleDao.findFrontArtiListByNavList(navList, offset, pageSize);
		
	}
	
	public long ffind_artiTotalCount(List<Navigation> navList){
		
		return articleDao.ffind_artiTotalCount(navList);
		
	}
	
	
	
	
	
}
